package com.shengde.jinwawaforleader.model.myJob.teachResource;


import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.shengde.jinwawaforleader.R;

/**
 * 教学资源 内容章节 详情
 */
public class JinriDetailActivity extends Activity {

	WebView show_wv;
	TextView bt_fabu;
	String url;
	String keyField;
	String title;
	String cover;
	String id;
	private LinearLayout loading_main;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_jinri_detail);
//		bt_fabu = (TextView) findViewById(R.id.bt_fabu);
		loading_main = (LinearLayout) findViewById(R.id.loading_main);
		new Handler().postDelayed(new Runnable() {
			public void run() {
				//bt_fabu.setText("发布");
			}
		}, 1500);

		show_wv = (WebView) findViewById(R.id.show_wv);
		WebSettings settings = show_wv.getSettings();
		settings.setJavaScriptEnabled(true);
		settings.setSupportZoom(true);
		settings.setBuiltInZoomControls(true);
		url = getIntent().getStringExtra("url");
		keyField = getIntent().getStringExtra("keyField");
		title = getIntent().getStringExtra("title");
		cover = getIntent().getStringExtra("cover");
		id = getIntent().getStringExtra("id");

		show_wv.setWebViewClient(new WebViewClient(){
			@Override
			public void onPageFinished(WebView view, String url) {
				super.onPageFinished(view, url);
				loading_main.setVisibility(View.GONE);
			}
		});
		show_wv.loadUrl(url);


		findViewById(R.id.tv_back).setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				finish();
			}
		});
	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		show_wv.stopLoading();
		show_wv.destroy();
		super.onDestroy();
	}
}
